<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html:html lang="true">
<head>
	<html:base />

	<title>photo_list.jsp</title>

	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/base.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/base_orange.css" />

</head>

<body>
	<html:form action="/album_photo">
		<table class="title1">
			<tr>
				<td class="title1_td1">
					相 册 - ${albumName}
				</td>
				<td class="title1_td2">
					<input class="button_2zi" type="button" value="上 传"
						onclick="dosubmit(this.form, '../album_photo.do?method=insertAlbumPhoto');" />
					<input class="button_2zi" type="button" value="修 改"
						onclick="dosubmit(this.form, '../album_photo.do?method=updateAlbumPhoto', 'update');" />
					<input class="button_2zi" type="button" value="删 除"
						onclick="dosubmit(this.form, '../album_photo.do?method=deleteAlbumPhotos', 'delete');" />
					<input class="button_6zi" type="button" value="返回相册列表"
						onclick="dosubmit(this.form, '../album.do?method=getAlbumsByPage&searchFlag=1');" />
				</td>
			</tr>
		</table>
		<table class="table3">
			<tr>
				<td colspan="5">
					<input type="checkbox" onclick="selectAll('id',this.checked)" />全选
					<html:hidden property="albumId" />
				</td>
			</tr>
			
			<!-- 循环输出图片列表 -->
			<c:set var="i" value="0"></c:set>
			<logic:iterate id="albumPhotoForm" name="albumPhotoFormList">
				<!-- 1行显示6个 -->
				<c:if test="${i%6==0}">
					<%="<tr>" %>
				</c:if>
				<!-- 1个格内包括：图片、图片说明、按钮 -->
				<td width="16.5%" align="center">
					<img src="<%=request.getContextPath()%>${albumPhotoForm.thumbUrl}" alt="${albumPhotoForm.des}" width="120" height="80" />
					<br />
					<html:checkbox property="id" value="${albumPhotoForm.id}" />
					${albumPhotoForm.des}
					<br />
					<input onclick="dosubmit(this.form, '../album.do?method=updateAlbumCover&coverId=${albumPhotoForm.id}');" value="设为相册封面" type="button" class="button_6zi" />
					<br /><br /><br />
				</td>
				<c:if test="${i%6==5}">
					<%="</tr>" %>
				</c:if>
				<c:set var="i" value="${i+1}"></c:set>
			</logic:iterate>
			<!-- 最后1行不足6个格子，需填满 -->
			<c:forEach var="i" begin="${i}" end="5" step="1">
				<%="<td width=\"16.5%\" align=\"center\">&nbsp;</td>"%>
			</c:forEach>
			<%="</tr>" %>
			
		</table>
		<jsp:include page="/admin/core/page_info/page_info.jsp"></jsp:include>
	</html:form>
</body>
</html:html>
